<html> 

<head> 
<meta charset="utf-8">
<script type="text/javascript"> 
function whichButton(event) 
{ 
if (event.button==2) 
{ 
alert("你点击了鼠标右键!") 
} 
else 
{ 
alert("你点击了鼠标左键!") 
} 
} 
</script> 
</head> 

<body onmousedown="whichButton(event)"> 
<p>请单击你鼠标的左键或右键试试</p> 
</body> 
</html> 
